home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Games / NetHack 3.1.3 / source / include / hack.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-08-01  |  4.3 KB  |  212 lines  |  [TEXT/R*ch]

  1. /*    SCCS Id: @(#)hack.h    3.1    93/01/15    */
  2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  3. /* NetHack may be freely redistributed.  See license for details. */
  4.  
  5. #ifndef HACK_H
  6. #define HACK_H
  7.  
  8. #ifndef CONFIG_H
  9. #include "config.h"
  10. #endif
  11.  
  12. /* Some people comment out OVERLAY when uncommenting MOVERLAY */
  13. #if defined(MOVERLAY)
  14. # ifndef OVERLAY
  15. #  define OVERLAY
  16. # endif
  17. #endif
  18.  
  19. /*    For debugging beta code.    */
  20. #ifdef BETA
  21. #define Dpline    pline
  22. #endif
  23.  
  24. #define TELL        1
  25. #define NOTELL        0
  26. #define ON        1
  27. #define OFF        0
  28. #define BOLT_LIM    8    /* from this distance ranged attacks will be made */
  29. #define MAX_CARR_CAP    1000    /* so that boulders can be heavier */
  30. #ifndef __SASC_60
  31. #ifdef NULL
  32. #undef NULL
  33. #endif /* NULL */
  34. #define NULL  ((char *)0)
  35. #endif
  36. #define DUMMY { 0 }
  37.  
  38. /* symbolic names for capacity levels */
  39. #define UNENCUMBERED    0
  40. #define SLT_ENCUMBER    1
  41. #define MOD_ENCUMBER    2
  42. #define HVY_ENCUMBER    3
  43. #define EXT_ENCUMBER    4
  44. #define OVERLOADED    5
  45.  
  46. /* this is the way the game ends */
  47. /* if these are rearranged, the arrays in end.c will need to be changed */
  48. #define DIED         0
  49. #define CHOKING         1
  50. #define POISONING     2
  51. #define STARVING     3
  52. #define DROWNING     4
  53. #define BURNING         5
  54. #define CRUSHING     6
  55. #define STONING         7
  56. #define GENOCIDED     8
  57. #define PANICKED     9
  58. #define TRICKED        10
  59. #define QUIT        11
  60. #define ESCAPED        12
  61. #define ASCENDED    13
  62.  
  63. #ifndef DUNGEON_H    /* includes align.h */
  64. #include "dungeon.h"
  65. #endif
  66.  
  67. #ifndef MONSYM_H
  68. #include "monsym.h"
  69. #endif
  70. #ifndef MKROOM_H
  71. #include "mkroom.h"
  72. #endif
  73. #ifndef OBJCLASS_H
  74. #include "objclass.h"
  75. #endif
  76.  
  77. #ifndef DECL_H
  78. #include "decl.h"
  79. #endif
  80.  
  81. NEARDATA extern coord bhitpos;    /* place where thrown weapon falls to the ground */
  82.  
  83. /* types of calls to bhit() */
  84. #define ZAPPED_WAND    0
  85. #define THROWN_WEAPON    1
  86. #define KICKED_WEAPON    2
  87. #define FLASHED_LIGHT    3
  88. #define INVIS_BEAM    4
  89.  
  90. #ifndef TRAP_H
  91. #include "trap.h"
  92. #endif
  93. #ifndef FLAG_H
  94. #include "flag.h"
  95. #endif
  96.  
  97. #ifndef RM_H
  98. #include "rm.h"
  99. #endif
  100.  
  101. #ifndef VISION_H
  102. #include "vision.h"
  103. #endif
  104.  
  105. #ifndef DISPLAY_H
  106. #include  "display.h"
  107. #endif
  108.  
  109. #ifndef WINTYPE_H
  110. #include  "wintype.h"
  111. #endif
  112.  
  113. #ifndef ENGRAVE_H
  114. #include "engrave.h"
  115. #endif
  116.  
  117. #ifndef RECT_H
  118. #include "rect.h"
  119. #endif
  120.  
  121. #ifdef OVERLAY    /* This doesn't belong here, but we have little choice */
  122. #undef NDECL
  123. #define NDECL(f) f()
  124. #endif
  125.  
  126. #ifndef EXTERN_H
  127. #include "extern.h"
  128. #endif
  129.  
  130. #ifndef WINPROCS_H
  131. #include "winprocs.h"
  132. #endif
  133.  
  134. #if defined(OVERLAY) && !defined(MOVERLAY)
  135. #include "wintty.h"
  136. #undef WINTTY_H
  137.  
  138. #ifndef TRAMPOLI_H
  139. #include "trampoli.h"
  140. #endif
  141.  
  142. #undef EXTERN_H
  143. #include "extern.h"
  144. #endif /* OVERLAY */
  145.  
  146. #define NO_SPELL    0
  147.  
  148. /*** some utility macros ***/
  149. #define yn(query) yn_function(query,ynchars, 'n')
  150. #define ynq(query) yn_function(query,ynqchars, 'q')
  151. #define ynaq(query) yn_function(query,ynaqchars, 'y')
  152. #define nyaq(query) yn_function(query,ynaqchars, 'n')
  153. #define nyNaq(query) yn_function(query,ynNaqchars, 'n')
  154. #define ynNaq(query) yn_function(query,ynNaqchars, 'y')
  155.  
  156. #ifndef max
  157. #define max(a,b) ((a) > (b) ? (a) : (b))
  158. #endif
  159. #ifndef min
  160. #define min(x,y) ((x) < (y) ? (x) : (y))
  161. #endif
  162. #define plur(x)    (((x) == 1) ? "" : "s")
  163.  
  164. #define ARM_BONUS(obj)    (objects[(obj)->otyp].a_ac + (obj)->spe \
  165.              - min((int)(obj)->oeroded,objects[(obj)->otyp].a_ac))
  166.  
  167. #define makeknown(x)    discover_object((x),TRUE)
  168. #define distu(xx,yy)    dist2((int)(xx),(int)(yy),(int)u.ux,(int)u.uy)
  169. #define onlineu(xx,yy)    online2((int)(xx),(int)(yy),(int)u.ux,(int)u.uy)
  170.  
  171. #define rn1(x,y)    (rn2(x)+(y))
  172.  
  173. #ifndef MUSE
  174. #define find_mac(m)    ((m)->data->ac)
  175. #endif
  176.  
  177. #if defined(MICRO)
  178. #define getuid() 1
  179. #define getlogin() (NULL)
  180. #endif /* MICRO */
  181.  
  182. /* Macro for a few items that are only static if we're not overlaid.... */
  183. #if defined(OVERLAY)
  184. # define STATIC_PTR
  185. #else
  186. # define STATIC_PTR static
  187. #endif
  188.  
  189. #if defined(OVERLAY)&&(defined(OVL0)||defined(OVL1)||defined(OVL2)||defined(OVL3)||defined(OVLB))
  190. # define STATIC_DCL extern
  191. # define STATIC_OVL
  192. # ifdef OVLB
  193. #  define STATIC_VAR
  194. # else
  195. #  define STATIC_VAR extern
  196. # endif
  197.  
  198. #else    /* !OVERLAY || (!OVL0 && !OVL1 && !OVL2 && !OVL3 && !OVLB) */
  199. # define STATIC_DCL static
  200. # define STATIC_OVL static
  201. # define STATIC_VAR static
  202.  
  203. /* If not compiling an overlay, compile everything. */
  204. # define OVL0    /* Highest priority */
  205. # define OVL1
  206. # define OVL2
  207. # define OVL3    /* Lowest specified priority */
  208. # define OVLB    /* The base overlay segment */
  209. #endif    /* OVERLAY && (OVL0 || OVL1 || OVL2 || OVL3 || OVLB) */
  210.  
  211. #endif /* HACK_H */
  212.